//
//  LowPriceViewController.m
//  CwinCar
//
//  Created by dlios on 15/10/20.
//  Copyright © 2015年 dlios. All rights reserved.
//

#import "LowPriceViewController.h"
#import "BaseHeader.h"
@interface LowPriceViewController ()

@end

@implementation LowPriceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"商品详情";
    
#pragma mark 手写webView
    UIImageView *ImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, mainScreen_Width, mainScree_Height / 2.2)];
    [ImageView  sd_setImageWithURL:[NSURL URLWithString:self.WebModel.picurl]placeholderImage:[UIImage imageNamed:@"zhanweitu"]];
    [self.view addSubview:ImageView];
    
    UILabel *titleLable = [[UILabel alloc]initWithFrame:CGRectMake(mainScreen_Width / 18.5, mainScree_Height / 2.1 , mainScreen_Width - mainScreen_Width / 9.3, mainScree_Height * 0.105)];
    titleLable.font = [UIFont systemFontOfSize:17];
    titleLable.numberOfLines = 0;
    titleLable.text = self.WebModel.title;
    [self.view addSubview:titleLable];
    
    UIView *redView = [[UIView alloc]initWithFrame:CGRectMake(0, mainScree_Height/1.73, mainScreen_Width, mainScree_Height * 0.045)];
    [redView setBackgroundColor:[UIColor colorWithRed:255/255. green:242/255. blue:237/255. alpha:1]];
    [self.view addSubview:redView];
    
    UILabel *priceLabel = [[UILabel alloc]initWithFrame:CGRectMake(mainScreen_Width / 7.5, mainScree_Height / 1.73, mainScreen_Width / 2, mainScree_Height * 0.045)];
    priceLabel.text = self.WebModel.price;
    priceLabel.textColor = [UIColor redColor];
    [self.view addSubview:priceLabel];
    
    UILabel *discountLabel = [[UILabel alloc]initWithFrame:CGRectMake(mainScreen_Width / 1.6, mainScree_Height / 1.73,  mainScreen_Width / 3.5, mainScree_Height *0.045)];
    discountLabel.text = [NSString stringWithFormat:@"折扣:  %@",self.WebModel.discount ];
    [self.view addSubview:discountLabel];
    
    UILabel *shopLabel = [[UILabel alloc]initWithFrame:CGRectMake(0 , mainScree_Height / 1.58 ,mainScreen_Width  , mainScree_Height * 0.045)];
    shopLabel.text = [NSString stringWithFormat:@"店 名:  %@",self.WebModel.shopname ];
    shopLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:shopLabel];
    
    self.navigationItem.hidesBackButton = YES;
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"fanhui"] style:UIBarButtonItemStylePlain target:self action:@selector(backAction:)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
  
}

#pragma mark 返回按钮
- (void)backAction:(UIBarButtonItem *)leftBarButtonItem
{
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
